package com.easy.yours.biz.model;

import com.easy.system.model.BaseBean;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: sunguangzhu
 * Date: 13-7-30
 * Time: 下午9:50
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "t_clazz", catalog = "commonproject")
public class Clazz extends BaseBean {
    private String name;
    private Set<Student> students = new HashSet<Student>(0);

    public Clazz() {
    }

    public Clazz(String name, Set<Student> students) {
        this.name = name;
        this.students = students;
    }

    @Column
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "clazz")
    public Set<Student> getStudents() {
        return students;
    }

    public void setStudents(Set<Student> students) {
        this.students = students;
    }
}
